package cs.uns.edu.ar.aygps.view;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import javax.swing.JPanel;

@SuppressWarnings ({"serial"})
public class BackGroundPanel extends JDesktopPane {
	
	private Image img;

	  public BackGroundPanel(String img) {
	    this(new ImageIcon(img).getImage());
	  }

	  public BackGroundPanel(Image img) {
	    this.img = img;
	  }

	  protected void paintComponent(Graphics g) {
		Dimension d = getSize();
	    g.drawImage(img, 0, 0, d.width,d.height,this);
	  }

}
